<template>
    <div id="topbar">
        <ul  style="margin:0px">
        <el-tag v-for="tag in list" :key="tag" closable :type="''" @close="close(tag)"  @click="to(tag)" style="margin-right:2px;cursor: pointer;">
            {{ tag }}
        </el-tag>
        </ul>
    </div>
</template>

<script>


export default {
    props:{
        list:[]
    },
    methods:{
        to(item){
            // console.log(item);
            switch(item){
                case "报道信息":
                    this.$router.push("/ArriveMange");
                    break;
                case "缴费信息":
                    this.$router.push("/BillMange");
                    break;
                case "个人信息":
                    this.$router.push("/Information");
                    break;
                case "宿舍选取":
                    this.$router.push("/DormitoryMange");
                    break;
                case "报道管理":
                    this.$router.push("/ArriveInformation");
                    break;
                case "用户管理":
                    this.$router.push("/UserInformation");
                    break;
                case "宿舍管理":
                    this.$router.push("/DormitoryInformation");
                    break;
                case "学生管理":
                    this.$router.push("/StudentInformation");
                    break;
                case "数据概况":
                    this.$router.push("/SumInformation");
                    break;
            }
        },
        close(item){
            this.list.splice(this.list.indexOf(item), 1)
        }
    }
}
</script>
<style scoped>
#topbar{
    width: 100%;
    height: 40px;
    text-align: initial;
    line-height: 40px;
    background-color: #ffffff;
    border-bottom: 0.7px solid rgba(0, 0, 0, .2);
}
</style>